<?php


namespace app\services\system;


use app\dao\system\SystemExtractDao;
use app\services\BaseServices;
use think\exception\ValidateException;

/**
 * Class SystemRouteServices
 * @author 等风来
 * @email 136327134@qq.com
 * @date 2023/4/6
 * @package app\services\system
 */
class SystemExtractServices extends BaseServices
{
    /**
     * SystemRouteServices constructor.
     * @param SystemExtractDao $dao
     */
    public function __construct(SystemExtractDao $dao)
    {
        $this->dao = $dao;
    }

    /**
     * @param int $id
     * @return array
     * @author 等风来
     * @email 136327134@qq.com
     * @date 2023/4/10
     */
    public function getInfo(int $id)
    {
        $info = $this->dao->get($id)->toArray();
        if (!$info) {
            throw new ValidateException(500036);
        }
        return $info;
    }
}